package com.project.myBeans;

/**
 * Created by TAO on 2015/10/7.
 */

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

/**
 * 此类封装返回给app端或web端的数据和状态信息
 * 说明：
 * 增、删、改操作，一般会用到属性：success,message；
 * 查询操作：用到success,data,total。
 */

public class ResponseBean<T> {

    private boolean success = true; //true:操作成功, false:操作失败
    private String message = "";    //操作提示信息
    private int flag = 0;    //辅助状态标志,如1-验证成功;2-验证失败
    private T data = null; //单条数据 或 多条数据 皆可
    private int total = 0; //data中返回记录总数

    public boolean getSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public ResponseBean() {
    }
}



